//
//  MessageLisitVC.m
//  PersonalOC
//
//  Created by 韩琴 on 2018/8/21.
//  Copyright © 2018年 韩琴. All rights reserved.
//

#import "MessageLisitVC.h"
#import "MessageCell.h"

@interface MessageLisitVC ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)BaseTableView *mainTableView;
@property (nonatomic,assign) int page;
@property (nonatomic,copy) NSMutableArray *lisitArrary;
@property (nonatomic,copy) PageModle *pageModle;
@end

@implementation MessageLisitVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.page = 1;
    self.lisitArrary = [[NSMutableArray alloc] init];
    [self beginRefresh];
}
- (void)viewWillAppear:(BOOL)animated {
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)loadUI {
    //TableView
    BaseTableView *maintabel = [[BaseTableView alloc] init];
    [self.view addSubview:maintabel];
    self.mainTableView = maintabel;
    [maintabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.equalTo(@0);
    }];
    maintabel.delegate = self;
    maintabel.dataSource = self;
        maintabel.ly_emptyView = [LYEmptyView emptyViewWithImageStr:@"暂无数据" titleStr:@"暂无数据" detailStr:@""];
//    maintabel.ly_emptyView = [LYEmptyView emptyActionViewWithImageStr:@"" titleStr:@"重新加载" detailStr:@"" btnTitleStr:@"好的" btnClickBlock:^{
//        //        [LYTools showMessage:@"在加载..."];
//        //        [LYView showBottomLoading:@"加载中..."];
//        //        [MBProgressHUD showHUDAddedTo:self.view animated:true];
//        [MBProgressHUD show:@"成公" icon:@"消息" view:nil];
//
//    }];
    maintabel.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self registerCell];
    self.mainTableView.estimatedRowHeight = 44;
    [LYTools tableViewAddRefreshHeader:self.mainTableView withTarget:self refreshingAction:@selector(beginRefresh)];
//    [LYTools tableViewAddRefreshFooter:self.mainTableView withTarget:self refreshingAction:@selector(getMoreData)];
}
//注册Cell
- (void)registerCell{
    [self.mainTableView registerNib:[UINib nibWithNibName:@"MessageCell" bundle:nil] forCellReuseIdentifier:@"MessageCell"];
}
#pragma mark -- tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MessageCell" forIndexPath:indexPath];
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewAutomaticDimension;
}
#pragma mark -- 事件
- (void)beginRefresh {
//    self.page = 1;
//    self.lisitArrary = [NSMutableArray new];
    
    
}
- (void)getMoreData {
    
}
@end
